<?php
use common\widgets\Menu;

echo Menu::widget(
    [
        'options' => [
            'class' => 'sidebar-menu'
        ],
        'items' => [
            [
                'label' => Yii::t('app', 'Dashboard'),
                'url' => Yii::$app->homeUrl,
                'icon' => 'fa-dashboard',
                'active' => Yii::$app->request->url === Yii::$app->homeUrl
            ],
            [
                'label' => Yii::t('app', 'System'),
                'url' => ['#'],
                'icon' => 'fa fa-cog',
                'options' => [
                    'class' => 'treeview',
                ],
                'items' => [
                    [
                        'label' => Yii::t('app', 'User'),
                        'url' => ['/user/index'],
                        'icon' => 'fa fa-user',
                        //'visible' => (Yii::$app->user->identity->username == 'admin'),
                    ],
//                    [
//                        'label' => Yii::t('app', 'Role'),
//                        'url' => ['/role/index'],
//                        'icon' => 'fa fa-lock',
//                    ],
//                    [
//                        'label' => Yii::t('app', '任务'),
//                        'url' => ['/task/index'],
//                        'icon' => 'fa fa-tasks',
//                    ],
//                    [
//                        'label' => Yii::t('app', '今天吃什么'),
//                        'url' => ['/eat/index'],
//                        'icon' => 'fa fa-tasks',
//                    ],
                ],
            ],
            [
                'label' => Yii::t('app', 'customer_index'),
                'url' => ['#'],
                'icon' => 'fa fa-cog',
                'options' => [
                    'class' => 'treeview',
                ],
                'items' => [
                    [
                        'label' => Yii::t('app', 'customer_cat'),
                        'url' => ['/customer-cat/index'],
                        'icon' => 'fa fa-user',
                        //'visible' => (Yii::$app->user->identity->username == 'admin'),
                    ],
                    [
                        'label' => Yii::t('app', 'customer_list'),
                        'url' => ['/customer/index'],
                        'icon' => 'fa fa-lock',
                    ],

                ],
            ],
            [
                'label' => Yii::t('app', 'ad_manager'),
                'url' => ['#'],
                'icon' => 'fa fa-cog',
                'options' => [
                    'class' => 'treeview',
                ],
                'items' => [
                    [
                        'label' => Yii::t('app', 'ad_index'),
                        'url' => ['/ad/index?type=1' ],
                        'icon' => 'fa fa-user',
                        //'visible' => (Yii::$app->user->identity->username == 'admin'),
                    ],
                    [
                        'label' => Yii::t('app', 'ad_submit'),
                        'url' => ['/ad/index?type=2'],
                        'icon' => 'fa fa-lock',
                    ],
                    [
                        'label' => Yii::t('app', 'ad_customer_list'),
                        'url' => ['/ad/index?type=3'],
                        'icon' => 'fa fa-lock',
                    ],
                    [
                        'label' => Yii::t('app', 'ad_info_list'),
                        'url' => ['/ad/index?type=4'],
                        'icon' => 'fa fa-lock',
                    ],
                    [
                        'label' => Yii::t('app', 'ad_info_content'),
                        'url' => ['/ad/index?type=5'],
                        'icon' => 'fa fa-lock',
                    ],

                ],
            ],
            [
                'label' => Yii::t('app', 'info_manager'),
                'url' => ['#'],
                'icon' => 'fa fa-cog',
                'options' => [
                    'class' => 'treeview',
                ],
                'items' => [
                    [
                        'label' => Yii::t('app', 'supply_manager'),
                        'url' => ['/supply/index?type=1' ],
                        'icon' => 'fa fa-user',
                        //'visible' => (Yii::$app->user->identity->username == 'admin'),
                    ],
                    [
                        'label' => Yii::t('app', 'demand_manager'),
                        'url' => ['/supply/index?type=2' ],
                        'icon' => 'fa fa-user',
                        //'visible' => (Yii::$app->user->identity->username == 'admin'),
                    ],
                    [
                        'label' => Yii::t('app', 'contactor_manager'),
                        'url' => ['/contactor/index'],
                        'icon' => 'fa fa-user',
                    ],
                ],
            ],

        ]
    ]
);